home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_iierrmn.asp < prev    next >
Encoding:
Text File  |  1999-06-03  |  4.3 KB  |  202 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% 'Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <!--#include file="iierrhd.str"-->
  5.  
  6. <!--#include file="iisetfnt.inc"-->
  7. <HTML>
  8. <HEAD>
  9.     <TITLE></TITLE>
  10. </HEAD>
  11.  
  12. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" LINK="#000000" VLINK="#000000" TEXT="#000000" >
  13. <FORM NAME="userform">
  14. <%= sFont("","","",True) %>
  15. <B><%= L_CERR_TEXT %></B>
  16. <P>
  17. <TABLE WIDTH=490 BORDER=0>
  18.     <TR>
  19.         <TD COLSPAN=3  >
  20.             <%= sFont("","","",True) %>
  21.                 <%= L_CUSTOMERR_TEXT %>
  22.                 <BR> 
  23.             </FONT>
  24.         </TD>
  25.     </TR>
  26. </TABLE>
  27.  
  28.  
  29.  
  30. </FORM>
  31.  
  32. </BODY>
  33. <SCRIPT LANGUAGE="JavaScript">
  34.  
  35.     <!--#include file="iijsfuncs.inc"-->
  36.     <!--#include file="iijsls.inc"-->
  37.  
  38.     top.title.Global.helpFileName="iipy_13";
  39.  
  40.     function loadList(){
  41.         parent.list.location.href = "iierrls.asp";
  42.  
  43.     }
  44.     
  45.     function buildListForm(){
  46.         numrows=0;
  47.         for (var i=0; i < cachedList.length; i++) {
  48.             if (cachedList[i].outType !=""){
  49.                 numrows=numrows + 1;
  50.             }
  51.         }
  52.  
  53.         qstr="numrows="+numrows;
  54.         qstr=qstr+"&cols=HttpErrors";
  55.  
  56.         parent.parent.hlist.location.href="iihdn.asp?"+qstr;
  57.  
  58.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  59.     }
  60.  
  61.     function SetListVals(){
  62.  
  63.         listForm = parent.parent.hlist.document.hiddenlistform;    
  64.         j=0;
  65.         for (var i=0; i < cachedList.length; i++) {
  66.             if (cachedList[i].outType !=""){
  67.                 if (cachedList[i].Subcode == 0){
  68.                     sc = "*";
  69.                 }
  70.                 else{
  71.                     sc = cachedList[i].Subcode;
  72.                 }
  73.                 listForm.elements[j++].value=cachedList[i].error+","+sc+","+cachedList[i].outType+","+cachedList[i].msgPath;
  74.             }
  75.             cachedList[i].updated=false; 
  76.         }
  77.     }
  78.  
  79.     function listObj(i,e,s,o,p,d,t){
  80.         this.id = i;
  81.         
  82.         this.deleted=false;
  83.         this.newitem=false;
  84.         this.updated=false;
  85.         
  86.         this.error=initParam(e,"");
  87.         this.Subcode=initParam(s,"");
  88.         this.outType=initParam(o,"");
  89.         this.msgPath=initParam(p,"");
  90.         this.msgDefault=initParam(d,"");
  91.         this.types=initParam(t,"");
  92.  
  93.         //lookup from Custom_Error_Desc
  94.         if (s !=0){
  95.             this.errcode=e +":" + s;
  96.         }
  97.         else{
  98.             this.errcode=e
  99.         }
  100.         
  101.         this.displayPath = crop(this.msgPath,50);
  102.     }
  103.     
  104.     listFunc=new listFuncs("error","",top);
  105.     cachedList=new Array()
  106.  
  107. <%  
  108.     On Error Resume Next 
  109.     
  110.     Dim path, currentobj, infoobj, i, ErrItem, thisErr
  111.     Dim aErrs, aErrDescs
  112.     
  113.     path=Session("dpath")
  114.     Session("path")=path
  115.     Session("SpecObj")=""
  116.     Session("SpecProps")=""
  117.     Set currentobj=GetObject(path)
  118.     Set infoobj=GetObject("IIS://localhost/w3svc/info")
  119.  
  120.     aErrs=currentobj.GetEx("HttpErrors")
  121.     aErrDescs=infoobj.GetEx("CustomErrorDescriptions")
  122.  
  123.     if err <> 0 then
  124.          %>cachedList[0]=new listObj("","","","","","");<% 
  125.     else
  126.         i = 0
  127.         For Each ErrItem in aErrDescs
  128.             thisErr=getError(ErrItem,aErrs)
  129.              %>cachedList[<%= i %>]=new listObj(<%= i %>, "<%= thisErr(0) %>","<%= thisErr(1) %>","<%= thisErr(2) %>","<%= thisErr(3) %>","<%= thisErr(4) %>", <%= thisErr(5) %>);<%   
  130.              i = i+1
  131.         Next
  132.         Response.write "loadList();"
  133.     end if
  134.  
  135.  
  136. function getError(errstr,aErrs)
  137.     'bug bug
  138.     On Error Resume Next
  139.     Dim i, one, two, three, four, five, error
  140.     Dim Subcode, errtext, Subcodetext, def, path, otype, thistype
  141.     Dim CErr, aCErr
  142.  
  143.     one=Instr(errstr,",")
  144.     two=Instr((one+1),errstr,",")
  145.     three=Instr((two+1),errstr,",")
  146.     four=Instr((three+1),errstr,",")
  147.     five=Instr((four+1),errstr,",")
  148.         
  149.     otype=0
  150.     error=Mid(errstr,1,(one-1))
  151.     subcode=Mid(errstr,(one+1),((two-one)-1))
  152.     errtext=Mid(errstr,(two+1), (three-two)-1)
  153.     subcodetext=Mid(errstr,(three+1), (four-three)-1)
  154.     otype=Mid(errstr,(four+1))
  155.     path=errtext & " " & Subcodetext
  156.  
  157.     def=path
  158.     thistype=""
  159.     
  160.     if aErrs(0) <> "" then
  161.  
  162.     For Each CErr in aErrs
  163.         aCErr=getCustomErr(CErr)
  164.         if ((error=aCErr(0)) and (subcode=replace(aCErr(1),"*","0"))) then
  165.             thistype=aCErr(2)
  166.             path=aCErr(3)
  167.             exit for
  168.         end if
  169.         i = i + 1
  170.     Next
  171.     end if
  172.     
  173.     getError=Array(error, subcode, thistype,path,def,otype)
  174.     
  175. end function
  176.  
  177. function getCustomErr(errstr)
  178.     Dim one, two, three, code, Subcode, src, path
  179.         
  180.     one=Instr(errstr,",")
  181.     two=Instr((one+1),errstr,",")
  182.     three=Instr((two+1),errstr,",")
  183.     
  184.     code=Mid(errstr,1,(one-1))
  185.     Subcode=Mid(errstr,(one+1),((two-one)-1))
  186.     src=Mid(errstr,(two+1), (three-two)-1)
  187.     path=Mid(errstr,(three+1))
  188.  
  189.     path=replace(path,"\","\\")
  190.  
  191.     getCustomErr=Array(code, Subcode, src, path)
  192. end function
  193.  
  194.  %>
  195.  
  196.  
  197.  
  198.  
  199. </SCRIPT>
  200.  
  201. </HTML>
  202.